/*
Copyright (C) 2018-2019 de4dot@gmail.com

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

using System;
using System.Collections.Generic;
using System.Linq;
using Generator.Enums;

namespace Generator.Formatters {
	enum BroadcastToKind {
		None,
		b1to2,
		b1to4,
		b1to8,
		b1to16,
	}

	enum NasmMemoryKeywords {
		None,
		@byte,
		dword,
		far,
		fpuenv14,
		fpuenv28,
		fpustate108,
		fpustate94,
		oword,
		qword,
		tword,
		word,
		yword,
		zword,
	}

	enum MasmMemoryKeywords {
		None,
		byte_ptr,
		dword_bcst,
		dword_ptr,
		fpuenv14_ptr,
		fpuenv28_ptr,
		fpustate108_ptr,
		fpustate94_ptr,
		fword_ptr,
		oword_ptr,
		qword_bcst,
		qword_ptr,
		tbyte_ptr,
		word_ptr,
		xmmword_ptr,
		ymmword_ptr,
		zmmword_ptr,
	}

	enum IntelMemoryKeywords {
		None,
		byte_ptr,
		dword_ptr,
		fpuenv14_ptr,
		fpuenv28_ptr,
		fpustate108_ptr,
		fpustate94_ptr,
		fword_ptr,
		qword_ptr,
		tbyte_ptr,
		word_ptr,
		xmmword_ptr,
		ymmword_ptr,
		zmmword_ptr,
	}

	abstract class TableGen {
		protected abstract void Generate((EnumValue memSize, BroadcastToKind bcst, IntelMemoryKeywords intel, MasmMemoryKeywords masm, NasmMemoryKeywords nasm)[] memInfos);
		protected abstract void GenerateRegisters(string[] registers);
		protected abstract void GenerateFormatterFlowControl((EnumValue flowCtrl, EnumValue[] code)[] infos);

		protected readonly GenTypes genTypes;

		protected TableGen(GenTypes genTypes) =>
			this.genTypes = genTypes;

		public void Generate() {
			var memSize = genTypes[TypeIds.MemorySize];
			var memInfos = new (EnumValue memSize, BroadcastToKind bcst, IntelMemoryKeywords intel, MasmMemoryKeywords masm, NasmMemoryKeywords nasm)[] {
				(memSize["Unknown"], BroadcastToKind.None, IntelMemoryKeywords.None, MasmMemoryKeywords.None, NasmMemoryKeywords.None),
				(memSize["UInt8"], BroadcastToKind.None, IntelMemoryKeywords.byte_ptr, MasmMemoryKeywords.byte_ptr, NasmMemoryKeywords.@byte),
				(memSize["UInt16"], BroadcastToKind.None, IntelMemoryKeywords.word_ptr, MasmMemoryKeywords.word_ptr, NasmMemoryKeywords.word),
				(memSize["UInt32"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["UInt52"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["UInt64"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["UInt128"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["UInt256"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["UInt512"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Int8"], BroadcastToKind.None, IntelMemoryKeywords.byte_ptr, MasmMemoryKeywords.byte_ptr, NasmMemoryKeywords.@byte),
				(memSize["Int16"], BroadcastToKind.None, IntelMemoryKeywords.word_ptr, MasmMemoryKeywords.word_ptr, NasmMemoryKeywords.word),
				(memSize["Int32"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["Int64"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Int128"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Int256"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Int512"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["SegPtr16"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.far),
				(memSize["SegPtr32"], BroadcastToKind.None, IntelMemoryKeywords.fword_ptr, MasmMemoryKeywords.fword_ptr, NasmMemoryKeywords.far),
				(memSize["SegPtr64"], BroadcastToKind.None, IntelMemoryKeywords.tbyte_ptr, MasmMemoryKeywords.tbyte_ptr, NasmMemoryKeywords.far),
				(memSize["WordOffset"], BroadcastToKind.None, IntelMemoryKeywords.word_ptr, MasmMemoryKeywords.word_ptr, NasmMemoryKeywords.word),
				(memSize["DwordOffset"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["QwordOffset"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Bound16_WordWord"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.None),
				(memSize["Bound32_DwordDword"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.None),
				(memSize["Bnd32"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Bnd64"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.oword_ptr, NasmMemoryKeywords.oword),
				(memSize["Fword6"], BroadcastToKind.None, IntelMemoryKeywords.fword_ptr, MasmMemoryKeywords.fword_ptr, NasmMemoryKeywords.None),
				(memSize["Fword10"], BroadcastToKind.None, IntelMemoryKeywords.fword_ptr, MasmMemoryKeywords.fword_ptr, NasmMemoryKeywords.None),
				(memSize["Float16"], BroadcastToKind.None, IntelMemoryKeywords.word_ptr, MasmMemoryKeywords.word_ptr, NasmMemoryKeywords.word),
				(memSize["Float32"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["Float64"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Float80"], BroadcastToKind.None, IntelMemoryKeywords.tbyte_ptr, MasmMemoryKeywords.tbyte_ptr, NasmMemoryKeywords.tword),
				(memSize["Float128"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["BFloat16"], BroadcastToKind.None, IntelMemoryKeywords.word_ptr, MasmMemoryKeywords.word_ptr, NasmMemoryKeywords.word),
				(memSize["FpuEnv14"], BroadcastToKind.None, IntelMemoryKeywords.fpuenv14_ptr, MasmMemoryKeywords.fpuenv14_ptr, NasmMemoryKeywords.fpuenv14),
				(memSize["FpuEnv28"], BroadcastToKind.None, IntelMemoryKeywords.fpuenv28_ptr, MasmMemoryKeywords.fpuenv28_ptr, NasmMemoryKeywords.fpuenv28),
				(memSize["FpuState94"], BroadcastToKind.None, IntelMemoryKeywords.fpustate94_ptr, MasmMemoryKeywords.fpustate94_ptr, NasmMemoryKeywords.fpustate94),
				(memSize["FpuState108"], BroadcastToKind.None, IntelMemoryKeywords.fpustate108_ptr, MasmMemoryKeywords.fpustate108_ptr, NasmMemoryKeywords.fpustate108),
				(memSize["Fxsave_512Byte"], BroadcastToKind.None, IntelMemoryKeywords.None, MasmMemoryKeywords.None, NasmMemoryKeywords.None),
				(memSize["Fxsave64_512Byte"], BroadcastToKind.None, IntelMemoryKeywords.None, MasmMemoryKeywords.None, NasmMemoryKeywords.None),
				(memSize["Xsave"], BroadcastToKind.None, IntelMemoryKeywords.None, MasmMemoryKeywords.None, NasmMemoryKeywords.None),
				(memSize["Xsave64"], BroadcastToKind.None, IntelMemoryKeywords.None, MasmMemoryKeywords.None, NasmMemoryKeywords.None),
				(memSize["Bcd"], BroadcastToKind.None, IntelMemoryKeywords.tbyte_ptr, MasmMemoryKeywords.tbyte_ptr, NasmMemoryKeywords.tword),
				(memSize["Packed16_UInt8"], BroadcastToKind.None, IntelMemoryKeywords.word_ptr, MasmMemoryKeywords.word_ptr, NasmMemoryKeywords.word),
				(memSize["Packed16_Int8"], BroadcastToKind.None, IntelMemoryKeywords.word_ptr, MasmMemoryKeywords.word_ptr, NasmMemoryKeywords.word),
				(memSize["Packed32_UInt8"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["Packed32_Int8"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["Packed32_UInt16"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["Packed32_Int16"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["Packed32_BFloat16"], BroadcastToKind.None, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_ptr, NasmMemoryKeywords.dword),
				(memSize["Packed64_UInt8"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Packed64_Int8"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Packed64_UInt16"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Packed64_Int16"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Packed64_UInt32"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Packed64_Int32"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Packed64_Float16"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Packed64_Float32"], BroadcastToKind.None, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_ptr, NasmMemoryKeywords.qword),
				(memSize["Packed128_UInt8"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_Int8"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_UInt16"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_Int16"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_UInt32"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_Int32"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_UInt52"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_UInt64"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_Int64"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_Float16"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_Float32"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_Float64"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed128_2xBFloat16"], BroadcastToKind.None, IntelMemoryKeywords.xmmword_ptr, MasmMemoryKeywords.xmmword_ptr, NasmMemoryKeywords.oword),
				(memSize["Packed256_UInt8"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Int8"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_UInt16"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Int16"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_UInt32"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Int32"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_UInt52"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_UInt64"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Int64"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_UInt128"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Int128"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Float16"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Float32"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Float64"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_Float128"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed256_2xBFloat16"], BroadcastToKind.None, IntelMemoryKeywords.ymmword_ptr, MasmMemoryKeywords.ymmword_ptr, NasmMemoryKeywords.yword),
				(memSize["Packed512_UInt8"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_Int8"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_UInt16"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_Int16"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_UInt32"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_Int32"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_UInt52"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_UInt64"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_Int64"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_UInt128"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_Float32"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_Float64"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Packed512_2xBFloat16"], BroadcastToKind.None, IntelMemoryKeywords.zmmword_ptr, MasmMemoryKeywords.zmmword_ptr, NasmMemoryKeywords.zword),
				(memSize["Broadcast64_UInt32"], BroadcastToKind.b1to2, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast64_Int32"], BroadcastToKind.b1to2, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast64_Float32"], BroadcastToKind.b1to2, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast128_UInt32"], BroadcastToKind.b1to4, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast128_Int32"], BroadcastToKind.b1to4, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast128_UInt52"], BroadcastToKind.b1to2, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast128_UInt64"], BroadcastToKind.b1to2, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast128_Int64"], BroadcastToKind.b1to2, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast128_Float32"], BroadcastToKind.b1to4, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast128_Float64"], BroadcastToKind.b1to2, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast256_UInt32"], BroadcastToKind.b1to8, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast256_Int32"], BroadcastToKind.b1to8, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast256_UInt52"], BroadcastToKind.b1to4, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast256_UInt64"], BroadcastToKind.b1to4, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast256_Int64"], BroadcastToKind.b1to4, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast256_Float32"], BroadcastToKind.b1to8, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast256_Float64"], BroadcastToKind.b1to4, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast512_UInt32"], BroadcastToKind.b1to16, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast512_Int32"], BroadcastToKind.b1to16, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast512_UInt52"], BroadcastToKind.b1to8, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast512_UInt64"], BroadcastToKind.b1to8, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast512_Int64"], BroadcastToKind.b1to8, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast512_Float32"], BroadcastToKind.b1to16, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast512_Float64"], BroadcastToKind.b1to8, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast128_2xInt16"], BroadcastToKind.b1to4, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast256_2xInt16"], BroadcastToKind.b1to8, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast512_2xInt16"], BroadcastToKind.b1to16, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast128_2xUInt32"], BroadcastToKind.b1to2, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast256_2xUInt32"], BroadcastToKind.b1to4, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast512_2xUInt32"], BroadcastToKind.b1to8, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast128_2xInt32"], BroadcastToKind.b1to2, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast256_2xInt32"], BroadcastToKind.b1to4, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast512_2xInt32"], BroadcastToKind.b1to8, IntelMemoryKeywords.qword_ptr, MasmMemoryKeywords.qword_bcst, NasmMemoryKeywords.qword),
				(memSize["Broadcast128_2xBFloat16"], BroadcastToKind.b1to4, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast256_2xBFloat16"], BroadcastToKind.b1to8, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
				(memSize["Broadcast512_2xBFloat16"], BroadcastToKind.b1to16, IntelMemoryKeywords.dword_ptr, MasmMemoryKeywords.dword_bcst, NasmMemoryKeywords.dword),
			};
			Generate(memInfos);
			var regs = genTypes[TypeIds.Register];
			var regInfos = new (EnumValue regEnum, string name)[] {
				(regs[nameof(Register.None)], "???"),
				(regs[nameof(Register.AL)], "al"),
				(regs[nameof(Register.CL)], "cl"),
				(regs[nameof(Register.DL)], "dl"),
				(regs[nameof(Register.BL)], "bl"),
				(regs[nameof(Register.AH)], "ah"),
				(regs[nameof(Register.CH)], "ch"),
				(regs[nameof(Register.DH)], "dh"),
				(regs[nameof(Register.BH)], "bh"),
				(regs[nameof(Register.SPL)], "spl"),
				(regs[nameof(Register.BPL)], "bpl"),
				(regs[nameof(Register.SIL)], "sil"),
				(regs[nameof(Register.DIL)], "dil"),
				(regs[nameof(Register.R8L)], "r8b"),
				(regs[nameof(Register.R9L)], "r9b"),
				(regs[nameof(Register.R10L)], "r10b"),
				(regs[nameof(Register.R11L)], "r11b"),
				(regs[nameof(Register.R12L)], "r12b"),
				(regs[nameof(Register.R13L)], "r13b"),
				(regs[nameof(Register.R14L)], "r14b"),
				(regs[nameof(Register.R15L)], "r15b"),
				(regs[nameof(Register.AX)], "ax"),
				(regs[nameof(Register.CX)], "cx"),
				(regs[nameof(Register.DX)], "dx"),
				(regs[nameof(Register.BX)], "bx"),
				(regs[nameof(Register.SP)], "sp"),
				(regs[nameof(Register.BP)], "bp"),
				(regs[nameof(Register.SI)], "si"),
				(regs[nameof(Register.DI)], "di"),
				(regs[nameof(Register.R8W)], "r8w"),
				(regs[nameof(Register.R9W)], "r9w"),
				(regs[nameof(Register.R10W)], "r10w"),
				(regs[nameof(Register.R11W)], "r11w"),
				(regs[nameof(Register.R12W)], "r12w"),
				(regs[nameof(Register.R13W)], "r13w"),
				(regs[nameof(Register.R14W)], "r14w"),
				(regs[nameof(Register.R15W)], "r15w"),
				(regs[nameof(Register.EAX)], "eax"),
				(regs[nameof(Register.ECX)], "ecx"),
				(regs[nameof(Register.EDX)], "edx"),
				(regs[nameof(Register.EBX)], "ebx"),
				(regs[nameof(Register.ESP)], "esp"),
				(regs[nameof(Register.EBP)], "ebp"),
				(regs[nameof(Register.ESI)], "esi"),
				(regs[nameof(Register.EDI)], "edi"),
				(regs[nameof(Register.R8D)], "r8d"),
				(regs[nameof(Register.R9D)], "r9d"),
				(regs[nameof(Register.R10D)], "r10d"),
				(regs[nameof(Register.R11D)], "r11d"),
				(regs[nameof(Register.R12D)], "r12d"),
				(regs[nameof(Register.R13D)], "r13d"),
				(regs[nameof(Register.R14D)], "r14d"),
				(regs[nameof(Register.R15D)], "r15d"),
				(regs[nameof(Register.RAX)], "rax"),
				(regs[nameof(Register.RCX)], "rcx"),
				(regs[nameof(Register.RDX)], "rdx"),
				(regs[nameof(Register.RBX)], "rbx"),
				(regs[nameof(Register.RSP)], "rsp"),
				(regs[nameof(Register.RBP)], "rbp"),
				(regs[nameof(Register.RSI)], "rsi"),
				(regs[nameof(Register.RDI)], "rdi"),
				(regs[nameof(Register.R8)], "r8"),
				(regs[nameof(Register.R9)], "r9"),
				(regs[nameof(Register.R10)], "r10"),
				(regs[nameof(Register.R11)], "r11"),
				(regs[nameof(Register.R12)], "r12"),
				(regs[nameof(Register.R13)], "r13"),
				(regs[nameof(Register.R14)], "r14"),
				(regs[nameof(Register.R15)], "r15"),
				(regs[nameof(Register.EIP)], "eip"),
				(regs[nameof(Register.RIP)], "rip"),
				(regs[nameof(Register.ES)], "es"),
				(regs[nameof(Register.CS)], "cs"),
				(regs[nameof(Register.SS)], "ss"),
				(regs[nameof(Register.DS)], "ds"),
				(regs[nameof(Register.FS)], "fs"),
				(regs[nameof(Register.GS)], "gs"),
				(regs[nameof(Register.XMM0)], "xmm0"),
				(regs[nameof(Register.XMM1)], "xmm1"),
				(regs[nameof(Register.XMM2)], "xmm2"),
				(regs[nameof(Register.XMM3)], "xmm3"),
				(regs[nameof(Register.XMM4)], "xmm4"),
				(regs[nameof(Register.XMM5)], "xmm5"),
				(regs[nameof(Register.XMM6)], "xmm6"),
				(regs[nameof(Register.XMM7)], "xmm7"),
				(regs[nameof(Register.XMM8)], "xmm8"),
				(regs[nameof(Register.XMM9)], "xmm9"),
				(regs[nameof(Register.XMM10)], "xmm10"),
				(regs[nameof(Register.XMM11)], "xmm11"),
				(regs[nameof(Register.XMM12)], "xmm12"),
				(regs[nameof(Register.XMM13)], "xmm13"),
				(regs[nameof(Register.XMM14)], "xmm14"),
				(regs[nameof(Register.XMM15)], "xmm15"),
				(regs[nameof(Register.XMM16)], "xmm16"),
				(regs[nameof(Register.XMM17)], "xmm17"),
				(regs[nameof(Register.XMM18)], "xmm18"),
				(regs[nameof(Register.XMM19)], "xmm19"),
				(regs[nameof(Register.XMM20)], "xmm20"),
				(regs[nameof(Register.XMM21)], "xmm21"),
				(regs[nameof(Register.XMM22)], "xmm22"),
				(regs[nameof(Register.XMM23)], "xmm23"),
				(regs[nameof(Register.XMM24)], "xmm24"),
				(regs[nameof(Register.XMM25)], "xmm25"),
				(regs[nameof(Register.XMM26)], "xmm26"),
				(regs[nameof(Register.XMM27)], "xmm27"),
				(regs[nameof(Register.XMM28)], "xmm28"),
				(regs[nameof(Register.XMM29)], "xmm29"),
				(regs[nameof(Register.XMM30)], "xmm30"),
				(regs[nameof(Register.XMM31)], "xmm31"),
				(regs[nameof(Register.YMM0)], "ymm0"),
				(regs[nameof(Register.YMM1)], "ymm1"),
				(regs[nameof(Register.YMM2)], "ymm2"),
				(regs[nameof(Register.YMM3)], "ymm3"),
				(regs[nameof(Register.YMM4)], "ymm4"),
				(regs[nameof(Register.YMM5)], "ymm5"),
				(regs[nameof(Register.YMM6)], "ymm6"),
				(regs[nameof(Register.YMM7)], "ymm7"),
				(regs[nameof(Register.YMM8)], "ymm8"),
				(regs[nameof(Register.YMM9)], "ymm9"),
				(regs[nameof(Register.YMM10)], "ymm10"),
				(regs[nameof(Register.YMM11)], "ymm11"),
				(regs[nameof(Register.YMM12)], "ymm12"),
				(regs[nameof(Register.YMM13)], "ymm13"),
				(regs[nameof(Register.YMM14)], "ymm14"),
				(regs[nameof(Register.YMM15)], "ymm15"),
				(regs[nameof(Register.YMM16)], "ymm16"),
				(regs[nameof(Register.YMM17)], "ymm17"),
				(regs[nameof(Register.YMM18)], "ymm18"),
				(regs[nameof(Register.YMM19)], "ymm19"),
				(regs[nameof(Register.YMM20)], "ymm20"),
				(regs[nameof(Register.YMM21)], "ymm21"),
				(regs[nameof(Register.YMM22)], "ymm22"),
				(regs[nameof(Register.YMM23)], "ymm23"),
				(regs[nameof(Register.YMM24)], "ymm24"),
				(regs[nameof(Register.YMM25)], "ymm25"),
				(regs[nameof(Register.YMM26)], "ymm26"),
				(regs[nameof(Register.YMM27)], "ymm27"),
				(regs[nameof(Register.YMM28)], "ymm28"),
				(regs[nameof(Register.YMM29)], "ymm29"),
				(regs[nameof(Register.YMM30)], "ymm30"),
				(regs[nameof(Register.YMM31)], "ymm31"),
				(regs[nameof(Register.ZMM0)], "zmm0"),
				(regs[nameof(Register.ZMM1)], "zmm1"),
				(regs[nameof(Register.ZMM2)], "zmm2"),
				(regs[nameof(Register.ZMM3)], "zmm3"),
				(regs[nameof(Register.ZMM4)], "zmm4"),
				(regs[nameof(Register.ZMM5)], "zmm5"),
				(regs[nameof(Register.ZMM6)], "zmm6"),
				(regs[nameof(Register.ZMM7)], "zmm7"),
				(regs[nameof(Register.ZMM8)], "zmm8"),
				(regs[nameof(Register.ZMM9)], "zmm9"),
				(regs[nameof(Register.ZMM10)], "zmm10"),
				(regs[nameof(Register.ZMM11)], "zmm11"),
				(regs[nameof(Register.ZMM12)], "zmm12"),
				(regs[nameof(Register.ZMM13)], "zmm13"),
				(regs[nameof(Register.ZMM14)], "zmm14"),
				(regs[nameof(Register.ZMM15)], "zmm15"),
				(regs[nameof(Register.ZMM16)], "zmm16"),
				(regs[nameof(Register.ZMM17)], "zmm17"),
				(regs[nameof(Register.ZMM18)], "zmm18"),
				(regs[nameof(Register.ZMM19)], "zmm19"),
				(regs[nameof(Register.ZMM20)], "zmm20"),
				(regs[nameof(Register.ZMM21)], "zmm21"),
				(regs[nameof(Register.ZMM22)], "zmm22"),
				(regs[nameof(Register.ZMM23)], "zmm23"),
				(regs[nameof(Register.ZMM24)], "zmm24"),
				(regs[nameof(Register.ZMM25)], "zmm25"),
				(regs[nameof(Register.ZMM26)], "zmm26"),
				(regs[nameof(Register.ZMM27)], "zmm27"),
				(regs[nameof(Register.ZMM28)], "zmm28"),
				(regs[nameof(Register.ZMM29)], "zmm29"),
				(regs[nameof(Register.ZMM30)], "zmm30"),
				(regs[nameof(Register.ZMM31)], "zmm31"),
				(regs[nameof(Register.K0)], "k0"),
				(regs[nameof(Register.K1)], "k1"),
				(regs[nameof(Register.K2)], "k2"),
				(regs[nameof(Register.K3)], "k3"),
				(regs[nameof(Register.K4)], "k4"),
				(regs[nameof(Register.K5)], "k5"),
				(regs[nameof(Register.K6)], "k6"),
				(regs[nameof(Register.K7)], "k7"),
				(regs[nameof(Register.BND0)], "bnd0"),
				(regs[nameof(Register.BND1)], "bnd1"),
				(regs[nameof(Register.BND2)], "bnd2"),
				(regs[nameof(Register.BND3)], "bnd3"),
				(regs[nameof(Register.CR0)], "cr0"),
				(regs[nameof(Register.CR1)], "cr1"),
				(regs[nameof(Register.CR2)], "cr2"),
				(regs[nameof(Register.CR3)], "cr3"),
				(regs[nameof(Register.CR4)], "cr4"),
				(regs[nameof(Register.CR5)], "cr5"),
				(regs[nameof(Register.CR6)], "cr6"),
				(regs[nameof(Register.CR7)], "cr7"),
				(regs[nameof(Register.CR8)], "cr8"),
				(regs[nameof(Register.CR9)], "cr9"),
				(regs[nameof(Register.CR10)], "cr10"),
				(regs[nameof(Register.CR11)], "cr11"),
				(regs[nameof(Register.CR12)], "cr12"),
				(regs[nameof(Register.CR13)], "cr13"),
				(regs[nameof(Register.CR14)], "cr14"),
				(regs[nameof(Register.CR15)], "cr15"),
				(regs[nameof(Register.DR0)], "dr0"),
				(regs[nameof(Register.DR1)], "dr1"),
				(regs[nameof(Register.DR2)], "dr2"),
				(regs[nameof(Register.DR3)], "dr3"),
				(regs[nameof(Register.DR4)], "dr4"),
				(regs[nameof(Register.DR5)], "dr5"),
				(regs[nameof(Register.DR6)], "dr6"),
				(regs[nameof(Register.DR7)], "dr7"),
				(regs[nameof(Register.DR8)], "dr8"),
				(regs[nameof(Register.DR9)], "dr9"),
				(regs[nameof(Register.DR10)], "dr10"),
				(regs[nameof(Register.DR11)], "dr11"),
				(regs[nameof(Register.DR12)], "dr12"),
				(regs[nameof(Register.DR13)], "dr13"),
				(regs[nameof(Register.DR14)], "dr14"),
				(regs[nameof(Register.DR15)], "dr15"),
				(regs[nameof(Register.ST0)], "st(0)"),
				(regs[nameof(Register.ST1)], "st(1)"),
				(regs[nameof(Register.ST2)], "st(2)"),
				(regs[nameof(Register.ST3)], "st(3)"),
				(regs[nameof(Register.ST4)], "st(4)"),
				(regs[nameof(Register.ST5)], "st(5)"),
				(regs[nameof(Register.ST6)], "st(6)"),
				(regs[nameof(Register.ST7)], "st(7)"),
				(regs[nameof(Register.MM0)], "mm0"),
				(regs[nameof(Register.MM1)], "mm1"),
				(regs[nameof(Register.MM2)], "mm2"),
				(regs[nameof(Register.MM3)], "mm3"),
				(regs[nameof(Register.MM4)], "mm4"),
				(regs[nameof(Register.MM5)], "mm5"),
				(regs[nameof(Register.MM6)], "mm6"),
				(regs[nameof(Register.MM7)], "mm7"),
				(regs[nameof(Register.TR0)], "tr0"),
				(regs[nameof(Register.TR1)], "tr1"),
				(regs[nameof(Register.TR2)], "tr2"),
				(regs[nameof(Register.TR3)], "tr3"),
				(regs[nameof(Register.TR4)], "tr4"),
				(regs[nameof(Register.TR5)], "tr5"),
				(regs[nameof(Register.TR6)], "tr6"),
				(regs[nameof(Register.TR7)], "tr7"),
			};
			Array.Sort(regInfos, (a, b) => a.regEnum.Value.CompareTo(b.regEnum.Value));
			if (new HashSet<EnumValue>(regInfos.Select(a => a.regEnum)).Count != regs.Values.Length)
				throw new InvalidOperationException();
			var list = regInfos.Select(a => a.name).ToList();
			// gas, intel, masm use 'st', nasm doesn't.
			list.Add("st");
			GenerateRegisters(list.ToArray());
			var flowCtrl = genTypes[TypeIds.FormatterFlowControl];
			var formatterFlowControlInfo = new (EnumValue flowCtrl, EnumValue[] code)[] {
				(flowCtrl["ShortBranch"],
					genTypes.GetKeptCodeValues(new[] {
						Code.Jo_rel8_16,
						Code.Jo_rel8_32,
						Code.Jo_rel8_64,
						Code.Jno_rel8_16,
						Code.Jno_rel8_32,
						Code.Jno_rel8_64,
						Code.Jb_rel8_16,
						Code.Jb_rel8_32,
						Code.Jb_rel8_64,
						Code.Jae_rel8_16,
						Code.Jae_rel8_32,
						Code.Jae_rel8_64,
						Code.Je_rel8_16,
						Code.Je_rel8_32,
						Code.Je_rel8_64,
						Code.Jne_rel8_16,
						Code.Jne_rel8_32,
						Code.Jne_rel8_64,
						Code.Jbe_rel8_16,
						Code.Jbe_rel8_32,
						Code.Jbe_rel8_64,
						Code.Ja_rel8_16,
						Code.Ja_rel8_32,
						Code.Ja_rel8_64,
						Code.Js_rel8_16,
						Code.Js_rel8_32,
						Code.Js_rel8_64,
						Code.Jns_rel8_16,
						Code.Jns_rel8_32,
						Code.Jns_rel8_64,
						Code.Jp_rel8_16,
						Code.Jp_rel8_32,
						Code.Jp_rel8_64,
						Code.Jnp_rel8_16,
						Code.Jnp_rel8_32,
						Code.Jnp_rel8_64,
						Code.Jl_rel8_16,
						Code.Jl_rel8_32,
						Code.Jl_rel8_64,
						Code.Jge_rel8_16,
						Code.Jge_rel8_32,
						Code.Jge_rel8_64,
						Code.Jle_rel8_16,
						Code.Jle_rel8_32,
						Code.Jle_rel8_64,
						Code.Jg_rel8_16,
						Code.Jg_rel8_32,
						Code.Jg_rel8_64,
						Code.Jmp_rel8_16,
						Code.Jmp_rel8_32,
						Code.Jmp_rel8_64,
					})
				),
				(flowCtrl["AlwaysShortBranch"],
					genTypes.GetKeptCodeValues(new[] {
						Code.Loopne_rel8_16_CX,
						Code.Loopne_rel8_32_CX,
						Code.Loopne_rel8_16_ECX,
						Code.Loopne_rel8_32_ECX,
						Code.Loopne_rel8_64_ECX,
						Code.Loopne_rel8_16_RCX,
						Code.Loopne_rel8_64_RCX,
						Code.Loope_rel8_16_CX,
						Code.Loope_rel8_32_CX,
						Code.Loope_rel8_16_ECX,
						Code.Loope_rel8_32_ECX,
						Code.Loope_rel8_64_ECX,
						Code.Loope_rel8_16_RCX,
						Code.Loope_rel8_64_RCX,
						Code.Loop_rel8_16_CX,
						Code.Loop_rel8_32_CX,
						Code.Loop_rel8_16_ECX,
						Code.Loop_rel8_32_ECX,
						Code.Loop_rel8_64_ECX,
						Code.Loop_rel8_16_RCX,
						Code.Loop_rel8_64_RCX,
						Code.Jcxz_rel8_16,
						Code.Jcxz_rel8_32,
						Code.Jecxz_rel8_16,
						Code.Jecxz_rel8_32,
						Code.Jecxz_rel8_64,
						Code.Jrcxz_rel8_16,
						Code.Jrcxz_rel8_64,
					})
				),
				(flowCtrl["NearCall"],
					genTypes.GetKeptCodeValues(new[] {
						Code.Call_rel16,
						Code.Call_rel32_32,
						Code.Call_rel32_64,
					})
				),
				(flowCtrl["NearBranch"],
					genTypes.GetKeptCodeValues(new[] {
						Code.Jo_rel16,
						Code.Jo_rel32_32,
						Code.Jo_rel32_64,
						Code.Jno_rel16,
						Code.Jno_rel32_32,
						Code.Jno_rel32_64,
						Code.Jb_rel16,
						Code.Jb_rel32_32,
						Code.Jb_rel32_64,
						Code.Jae_rel16,
						Code.Jae_rel32_32,
						Code.Jae_rel32_64,
						Code.Je_rel16,
						Code.Je_rel32_32,
						Code.Je_rel32_64,
						Code.Jne_rel16,
						Code.Jne_rel32_32,
						Code.Jne_rel32_64,
						Code.Jbe_rel16,
						Code.Jbe_rel32_32,
						Code.Jbe_rel32_64,
						Code.Ja_rel16,
						Code.Ja_rel32_32,
						Code.Ja_rel32_64,
						Code.Js_rel16,
						Code.Js_rel32_32,
						Code.Js_rel32_64,
						Code.Jns_rel16,
						Code.Jns_rel32_32,
						Code.Jns_rel32_64,
						Code.Jp_rel16,
						Code.Jp_rel32_32,
						Code.Jp_rel32_64,
						Code.Jnp_rel16,
						Code.Jnp_rel32_32,
						Code.Jnp_rel32_64,
						Code.Jl_rel16,
						Code.Jl_rel32_32,
						Code.Jl_rel32_64,
						Code.Jge_rel16,
						Code.Jge_rel32_32,
						Code.Jge_rel32_64,
						Code.Jle_rel16,
						Code.Jle_rel32_32,
						Code.Jle_rel32_64,
						Code.Jg_rel16,
						Code.Jg_rel32_32,
						Code.Jg_rel32_64,
						Code.Jmp_rel16,
						Code.Jmp_rel32_32,
						Code.Jmp_rel32_64,
						Code.Jmpe_disp16,
						Code.Jmpe_disp32,
					})
				),
				(flowCtrl["FarCall"],
					genTypes.GetKeptCodeValues(new[] {
						Code.Call_ptr1632,
						Code.Call_ptr1616,
					})
				),
				(flowCtrl["FarBranch"],
					genTypes.GetKeptCodeValues(new[] {
						Code.Jmp_ptr1632,
						Code.Jmp_ptr1616,
					})
				),
				(flowCtrl["Xbegin"],
					genTypes.GetKeptCodeValues(new[] {
						Code.Xbegin_rel16,
						Code.Xbegin_rel32,
					})
				),
			};
			GenerateFormatterFlowControl(formatterFlowControlInfo);
		}
	}
}
